home *** CD-ROM | disk | FTP | other *** search
/ People & Parliament - A …er's Guide to Westminster / People and Parliament - A Stranger's Guide to Westminster (1998)(House of Commons).iso / parl / 8bit80.dir / 00012_Script_12 < prev    next >
Text File  |  1998-03-23  |  11KB  |  350 lines

  1. on startmovie
  2.   global pointCursor, handCursor, grabCursor, yearList, lastYear, holList, lastHol, lastHoc, hocList
  3.   set pointCursor to [the number of member "pointer cursor", the number of member "pointer mask"]
  4.   set handCursor to [the number of member "hand cursor", the number of member "hand mask"]
  5.   set grabCursor to [the number of member "grab cursor", the number of member "grab mask"]
  6.   set yearList to ["intro","1066","1097","1215","1254","1265","1295","1341","1376","1523","1547","1605","1640","1678","1678a","1688","1694","1707","1716","1801","1803","1812","1832","1834","1852","1867","1911","1911a","1918","1918a","1941","1958","1978","1992"]
  7.   set lastYear = "intro"
  8.   set holList to ["intro","ORIGINS","THE LORDS' CHAMBER","MEMBERSHIP OF THE HOUSE","THE WORK OF THE LORDS","PROCEDURE","CEREMONIAL","REFORM OF THE LORDS"]
  9.   set lastHol to 0
  10.   set hocList to ["intro","history of the commons","the chamber","The Speaker","Membership of the House","The Work of the House","Government Bills","Committees","Procedure","Traditions and Customs"]
  11.   set lastHoc to 0
  12.   
  13.   global gQTVRObj
  14.   
  15.   -- register the Quicktime VR component
  16.   QTVREnter(xtra "QTVRXtra")
  17.   
  18.   -- create a new instance of the xtra
  19.   set gQTVRObj = new(xtra "QTVRXtra")
  20.   
  21. end
  22.  
  23. on stopMovie
  24.   global gQTVRObj
  25.   
  26.   -- Close any open QTVR movies
  27.   QTVRClose(gQTVRObj)
  28.   
  29.   -- unregister the Quicktime VR component
  30.   QTVRExit(xtra "QTVRXtra")
  31. end
  32.  
  33. on wait howlong
  34.   startTimer
  35.   repeat while the timer < howlong
  36.     nothing
  37.   end repeat
  38. end
  39.  
  40. on click
  41.   
  42.   if soundBusy (1) then
  43.     if the volume of sound 1 < 30 then
  44.       sound stop 1
  45.       puppetSound 2, "click"
  46.       updateStage
  47.       
  48.     else
  49.       sound fadeOut 1, 60
  50.       puppetSound 2, "click"
  51.       updateStage
  52.     end if
  53.   ELSE if soundBusy (2) then
  54.     if the volume of sound 2 < 30 then
  55.       sound stop 2
  56.       puppetSound 1, "click"
  57.       updateStage
  58.       
  59.     else
  60.       sound fadeOut 2, 60
  61.       puppetSound 1, "click"
  62.       updateStage
  63.       
  64.     end if
  65.   end if
  66.   
  67.   
  68. end
  69.  
  70. on press
  71.   set the member of sprite the clickOn to member (the memberNum of sprite the clickOn +1) of castLib (the castLibNum of sprite the clickOn)
  72.   click
  73.   wait 30
  74.   set the member of sprite the clickOn to member (the memberNum of sprite the clickOn -2) of castLib (the castLibNum of sprite the clickOn)
  75.   set the cursor of sprite the clickOn to -1
  76.   updateStage
  77. end
  78.  
  79. on advance
  80.   press
  81.   wipeDown
  82.   go next
  83. end
  84.  
  85. on stepBack
  86.   press
  87.   wipeDown
  88.   go previous
  89. end
  90.  
  91. on showPicture
  92.   --press
  93.   puppetSprite the clickOn, FALSE
  94.   dissolve
  95.   go to the frame +1
  96. end
  97.  
  98. on showText
  99.   --press
  100.   puppetSprite the clickOn, FALSE
  101.   dissolve
  102.   go to the frame -1
  103. end
  104.  
  105. on wipeDown
  106.   puppetTransition 03, 4
  107. end
  108.  
  109. on wipeRight
  110.   puppetTransition 01, 6
  111. end
  112.  
  113. on dissolve
  114.   puppetTransition 51, 6
  115. end
  116.  
  117. on circleDrag sNum,sC,whichHandler
  118.   puppetSprite sNum,true
  119.   set rC = the width of sprite sC/2
  120.   set rSNum to the width of sprite sNum/2
  121.   set cH to the locH of sprite sC + 1
  122.   set cV to the locV of sprite sC
  123.   set rC to rC - rSNum -2
  124.   set deltaH to the locH of the clickLoc - the locH of sprite sNum
  125.   set deltaV to the locV of the clickLoc - the locV of sprite sNum
  126.   
  127.   repeat while the mouseDown -- and the mouseCast = the number of member (the member of sprite 20)
  128.     if the mouseH < cH then
  129.       set mH to the mouseH - deltaH
  130.       set mV to the mouseV - deltaV
  131.       set A to mH - cH
  132.       set B to mV - cV
  133.       set r to sqrt(A*A + B*B)
  134.       
  135.       if A <> 0 then
  136.         set grad = float(B)/A
  137.         set constraint = 2.2 -- tan of 130 degrees swing
  138.         if grad <= constraint and grad >= 0 - constraint then
  139.           set angle = atan (grad) + atan (constraint)
  140.           do whichHandler && "angle / (atan(constraint)*2)" -- return percentage of travel
  141.           set newX = rC/sqrt(1+grad*grad)
  142.           if mH < cH then set newX to 0 - newX
  143.           set newY to Grad*newX
  144.           set the locH of sprite sNum to newX + cH
  145.           set the locV of sprite sNum to newY + cV
  146.         end if
  147.       end if
  148.       updateStage
  149.     end if
  150.   end repeat
  151. end
  152.  
  153. on displayMP percentVal
  154.   global whichMP, lastMP
  155.   set menuNum to integer(15 * percentval)
  156.   set menuNum to 15 - menuNum -- inverts
  157.   if menuNum = 0 then set menuNum =1
  158.   puppetSprite 18, TRUE
  159.   set the member of sprite 18 to member ("gp" && menuNum && "shadow")
  160.   puppetSprite 19, TRUE
  161.   set the member of sprite 19 to member ("gp" && menuNum && "title")
  162.   if lastMP <> menuNum then
  163.     set the visible of sprite 6 to FALSE
  164.     --    hideBalls
  165.     set lastMP = menuNum
  166.     puppetSound "tic"
  167.   end if
  168.   updateStage
  169.   set whichMP to menuNum -- return which menu item selected
  170. end
  171.  
  172. on displayDay percentVal
  173.   global whichDay, lastDay
  174.   set menuNum to integer(28 * percentval)
  175.   set menuNum to 28 - menuNum -- inverts
  176.   if menuNum = 0 then set menuNum =1
  177.   puppetSprite 18, TRUE
  178.   set the member of sprite 18 to member ("dt" && menuNum && "shadow")
  179.   puppetSprite 19, TRUE
  180.   set the member of sprite 19 to member ("dt" && menuNum && "title")
  181.   if lastDay <> menuNum then
  182.     set the visible of sprite 6 to FALSE
  183.     --    hideBalls
  184.     set lastDay = menuNum
  185.     puppetSound "tic"
  186.   end if
  187.   updateStage
  188.   set whichDay to menuNum -- return which menu item selected
  189. end
  190.  
  191. on displayYear percentVal
  192.   global yearList, whichYear, lastYear
  193.   set menuNum to integer(count(yearList) * percentval)
  194.   set menuNum to count(yearList) - menuNum -- inverts
  195.   if menuNum = 0 then set menuNum =1
  196.   puppetSprite 18, TRUE
  197.   set the member of sprite 18 to member ("tl" && string(getAt(yearList, menuNum)) && "shadow")
  198.   puppetSprite 19, TRUE
  199.   set the member of sprite 19 to member ("tl" && string(getAt(yearList, menuNum)) && "title")
  200.   if lastYear <> menuNum then
  201.     set the visible of sprite 6 to FALSE
  202.     hideBalls
  203.     set lastYear = menuNum
  204.     puppetSound "tic"
  205.   end if
  206.   updateStage
  207.   set whichYear to getAt(yearList, menuNum) -- return which menu item selected
  208. end
  209.  
  210. on displayLords percentVal
  211.   global holList, whichHol, lastHol
  212.   set menuNum to integer(count(holList) * percentval)
  213.   set menuNum to count(holList) - menuNum -- inverts
  214.   if menuNum = 0 then set menuNum =1
  215.   puppetSprite 18, TRUE
  216.   set the member of sprite 18 to member ("hol" && string(getAt(holList, menuNum)) && "TITLE SHADOW")
  217.   puppetSprite 19, TRUE
  218.   set the member of sprite 19 to member ("hol" && string(getAt(holList, menuNum)) && "TITLE")
  219.   if lastHol <> menuNum then
  220.     set the visible of sprite 6 to FALSE
  221.     hideBalls
  222.     set lastHol = menuNum
  223.     puppetSound "tic"
  224.   end if
  225.   updateStage
  226.   set whichHol to menuNum -1 -- return which menu item selected with offset to allow 0 value at intro
  227. end
  228.  
  229. on displayCommons percentVal
  230.   global hocList, whichHoc, lastHoc
  231.   set menuNum to integer(count(hocList) * percentval)
  232.   set menuNum to count(hocList) - menuNum -- inverts
  233.   if menuNum = 0 then set menuNum =1
  234.   puppetSprite 18, TRUE
  235.   set the member of sprite 18 to member ("hoc" && string(getAt(hocList, menuNum)) && "shadow")
  236.   puppetSprite 19, TRUE
  237.   set the member of sprite 19 to member ("hoc" && string(getAt(hocList, menuNum)))
  238.   if lastHoc <> menuNum then
  239.     set the visible of sprite 6 to FALSE
  240.     hideBalls
  241.     set lastHoc = menuNum
  242.     puppetSound "tic"
  243.   end if
  244.   updateStage
  245.   set whichHoc to menuNum -1 -- return which menu item selected with offset to allow 0 value at intro
  246. end
  247.  
  248. on hideBalls
  249.   repeat with n = 23 to 39
  250.     if the scoreColor of sprite n then
  251.       puppetSprite n, TRUE
  252.       set the member of sprite n to member "grey ball"
  253.     end if
  254.   end repeat
  255.   updateStage
  256. end
  257.  
  258. on showBalls
  259.   repeat with n = 23 to 39
  260.     puppetSprite n, FALSE
  261.   end repeat
  262.   updateStage
  263. end 
  264.  
  265. on clearPuppets
  266.   repeat with n = 2 to 39
  267.     puppetSprite n, FALSE
  268.     set the cursor of sprite n to 0
  269.   end repeat
  270.   repeat with n = 2 to 39
  271.     SET THE VISIBLE OF SPRITE n TO TRUE
  272.   end repeat
  273. end
  274.  
  275. on clearCursors
  276.   repeat with n = 3 to 24
  277.     set the cursor of sprite n to 0
  278.   end repeat
  279. end
  280.  
  281. on ballRolloverCheck whichColour
  282.   global pointCursor
  283.   if rollover(10) and the mouseCast = the number of member (the member of sprite 10) then
  284.     repeat with n = 11 to 14
  285.       puppetSprite n, TRUE
  286.     end repeat
  287.     set the member of sprite 11 to member (whichColour && "start button")
  288.     set the member of sprite 12 to member (whichColour && "menu button")
  289.     set the member of sprite 13 to member (whichColour && "previous button")
  290.     set the member of sprite 14 to member (whichColour && "next button")
  291.   else if rollover(11) then
  292.     repeat with n = 11 to 14
  293.       puppetSprite n, TRUE
  294.     end repeat
  295.     set the member of sprite 11 to member (whichColour && "start button white")
  296.     set the cursor of sprite 11 to pointCursor
  297.     set the member of sprite 12 to member (whichColour && "menu button")
  298.     set the member of sprite 13 to member (whichColour && "previous button")
  299.     set the member of sprite 14 to member (whichColour && "next button")
  300.   else if rollover(12) then
  301.     repeat with n = 11 to 14
  302.       puppetSprite n, TRUE
  303.     end repeat
  304.     set the member of sprite 11 to member (whichColour && "start button")
  305.     set the member of sprite 12 to member (whichColour && "menu button white")
  306.     set the cursor of sprite 12 to pointCursor
  307.     set the member of sprite 13 to member (whichColour && "previous button")
  308.     set the member of sprite 14 to member (whichColour && "next button")
  309.   else if rollover(13) then
  310.     repeat with n = 11 to 14
  311.       puppetSprite n, TRUE
  312.     end repeat
  313.     set the member of sprite 11 to member (whichColour && "start button")
  314.     set the member of sprite 12 to member (whichColour && "menu button")
  315.     if the scriptNum of sprite 13 then -- check to see if any lingo attached to previous button
  316.       set the member of sprite 13 to member (whichColour && "previous button white")
  317.       set the cursor of sprite 13 to pointCursor
  318.     end if
  319.     set the member of sprite 14 to member (whichColour && "next button")
  320.   else if rollover(14) then
  321.     repeat with n = 11 to 14
  322.       puppetSprite n, TRUE
  323.     end repeat
  324.     set the member of sprite 11 to member (whichColour && "start button")
  325.     set the member of sprite 12 to member (whichColour && "menu button")
  326.     set the member of sprite 13 to member (whichColour && "previous button")
  327.     if the scriptNum of sprite 14 then -- check to see if any lingo attached to next button
  328.       set the member of sprite 14 to member (whichColour && "next button white")
  329.       set the cursor of sprite 14 to pointCursor
  330.     end if
  331.   else
  332.     repeat with n = 11 to 14
  333.       puppetSprite n, FALSE
  334.       set the cursor of sprite n to -1
  335.     end repeat
  336.   end if
  337.   if rollover(20) then -- picture/text icons
  338.     puppetSprite 20, TRUE
  339.     set the cursor of sprite 20 to pointCursor
  340.     if the scoreColor of sprite 20 = 2 then -- picture icon is green cell
  341.       set the member of sprite 20 to member "picture icon red"
  342.     else
  343.       set the member of sprite 20 to member "text icon red"
  344.     end if
  345.   else
  346.     puppetSprite 20, FALSE
  347.     set the cursor of sprite 20 to -1
  348.   end if
  349. end
  350.